<script type="text/javascript">
$(document).ready(function () {
	$("#form1").submit( function () {
		var s_num = parseInt($("#send_num").val());
		var l_num = parseInt($("#last_number").html());
		{%if $smarty.get.high_replacement_id%}
		if(s_num>l_num){
			alert('数量不能超过剩余数量');
			return false;
		}
		{%/if%}	
	}); 
})
</script>

<h2 class="title">库请记录</h2>
<form action="index.php?c=zy_send_storehouse_details&m={%$act%}&post=1" method=post name=frm enctype="multipart/form-data" id="form1" onSubmit="return Validator.Validate(this,3)">
<table class="tb_term" width="100%">
<tr>
	<td class="alignright">物资编码</td>
	<td colspan="3">
		<input type=text name="materials_no" id="materials_no" class="input_edit_stand txt-normal" {%if $smarty.get.high_replacement_id%}value="{%$high_one.materials_no%}"{%else%}value='{%$materials_no%}'{%/if%} dataType="Require" msg="" />
		<input type="hidden" name="send_record_id" value="{%$smarty.get.send_record_id%}">&nbsp;
		{%if $is_show neq 1%}
		<a href="index.php?c=zy_high_replacement&m=get_high&send_record_id={%$smarty.get.send_record_id%}">请选择</a>
		{%/if%}
	</td>
</tr>
<tr>	
	<td class="tr_td_width01 alignright">部件号</td>
	<td class="tr_td_width03"><input type=text name="part_number" id="part_number" class="input_edit_stand txt-normal" value="{%if $smarty.get.high_replacement_id%}{% $high_one.part_number %}{%else%}{%$part_number%}{%/if%}" dataType="Require" msg="" /></td>
	<td  class="tr_td_width01 alignright">物资名称</td>
	<td><input type=text name="materials_name" id="materials_name" class="input_edit_stand txt-normal" {%if $smarty.get.high_replacement_id%}value="{% $high_one.materials_name %}"{%else%}value="{%$materials_name%}"{%/if%} dataType="Require" msg="" /></td>
</tr>
<tr>
	<td class="alignright">规格型号</td>
	<td><input type=text name="format_model" class="input_edit_stand txt-normal" {%if $smarty.get.high_replacement_id%}value="{% $high_one.format_model %}"{%else%}value="{% $format_model %}"{%/if%} /></td>
	<td class="alignright">订单号</td>
	<td><input type=text name="order_no" class="input_edit_stand txt-normal" value='{% $order_no %}'></td>
</tr>
<tr>	
	<td class="alignright">数量</td>
	<td colspan="3">
		<input type=text name="send_num" id="send_num" class="input_edit_num txt-normal" value="{%$send_num%}" dataType="Require" msg="" />
		{%if $smarty.get.high_replacement_id%}
		<font color="red">数量最多不能超过<span id="last_number" >{% $high_one.last_number %}</span></font>	
		<input type="hidden" name="high_replacement_id" value="{%$smarty.get.high_replacement_id%}">
		{%/if%}
	</td>
</tr>
<tr>
	<td class="alignright">单位</td>
	<td><input type=text name="s_unit" class="input_edit_num txt-normal"  value='{%$s_unit%}'></td>
	<td class="alignright">所属项目</td>
	<td>
		<select name="project_id" class="select_edit02 txt-normal">
			{%html_options options=$project_arr selected=$project_id%}
		</select>
	</td>
</tr>
<tr>
	<td class="alignright">备注</td>
	<td colspan="3"><textarea cols="70" rows="3" class="textarea_edit txt-normal" id="contactus" name="remarks" >{%$remarks%}</textarea></td>
</tr>

</table>
{%if $is_show eq 1%}
<p class="btn_right">
	<button type="button" class="b-default" hidefocus="true" onclick="javascript:history.go(-1)"><span><em>返回</em></span></button>
</p>
{%else%}
<p class="btn_right">
	<input type=hidden name='details_id' id='details_id' value='{%$details_id%}'>
	<button type="submit" class="b-default" hidefocus="true"><span><em>提交</em></span></button>
	<button type="button" class="b-default" hidefocus="true" onclick="javascript:history.go(-1)"><span><em>返回</em></span></button>
</p>
{%/if%}
</form>